app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
↳ QTRS
↳ DependencyPairsProof
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, xs), app2(app2(cons, y), ys))
LIST2 -> APP2(s, 0)
APP2(app2(plus, app2(s, x)), y) -> APP2(s, app2(app2(plus, x), y))
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys))))
LIST3 -> HAMMING
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(lt, x)
HAMMING -> APP2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
HAMMING -> LIST3
LIST3 -> APP2(s, 0)
LIST1 -> HAMMING
APP2(app2(mult, app2(s, x)), y) -> APP2(app2(plus, y), app2(app2(mult, x), y))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys)))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(eq, x)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))
LIST1 -> APP2(map, app2(mult, app2(s, app2(s, 0))))
APP2(app2(plus, app2(s, x)), y) -> APP2(app2(plus, x), y)
APP2(app2(mult, app2(s, x)), y) -> APP2(plus, y)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(lt, x), y)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, app2(app2(cons, x), xs)), ys)
HAMMING -> APP2(merge, list2)
APP2(app2(mult, app2(s, x)), y) -> APP2(mult, x)
LIST3 -> APP2(s, app2(s, app2(s, app2(s, app2(s, 0)))))
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(cons, app2(f, x))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(merge, xs)
LIST2 -> APP2(s, app2(s, app2(s, 0)))
HAMMING -> APP2(s, 0)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(eq, x), y)
LIST2 -> APP2(s, app2(s, 0))
LIST1 -> APP2(mult, app2(s, app2(s, 0)))
LIST2 -> APP2(mult, app2(s, app2(s, app2(s, 0))))
HAMMING -> APP2(app2(merge, list1), app2(app2(merge, list2), list3))
HAMMING -> LIST2
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys)))
LIST1 -> APP2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, xs), ys)
APP2(app2(lt, app2(s, x)), app2(s, y)) -> APP2(lt, x)
HAMMING -> APP2(cons, app2(s, 0))
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(f, x)
APP2(app2(mult, app2(s, x)), y) -> APP2(app2(mult, x), y)
LIST2 -> HAMMING
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(if, app2(app2(eq, x), y))
APP2(app2(plus, app2(s, x)), y) -> APP2(plus, x)
LIST3 -> APP2(s, app2(s, 0))
APP2(app2(lt, app2(s, x)), app2(s, y)) -> APP2(app2(lt, x), y)
LIST1 -> APP2(s, app2(s, 0))
LIST3 -> APP2(s, app2(s, app2(s, app2(s, 0))))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(if, app2(app2(lt, x), y))
HAMMING -> APP2(app2(merge, list2), list3)
HAMMING -> LIST1
LIST2 -> APP2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
LIST3 -> APP2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0)))))))
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(app2(map, f), xs)
LIST3 -> APP2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))
HAMMING -> APP2(merge, list1)
LIST3 -> APP2(s, app2(s, app2(s, 0)))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
LIST3 -> APP2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
LIST2 -> APP2(map, app2(mult, app2(s, app2(s, app2(s, 0)))))
LIST1 -> APP2(s, 0)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(cons, x), app2(app2(merge, xs), ys))
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, xs), app2(app2(cons, y), ys))
LIST2 -> APP2(s, 0)
APP2(app2(plus, app2(s, x)), y) -> APP2(s, app2(app2(plus, x), y))
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys))))
LIST3 -> HAMMING
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(lt, x)
HAMMING -> APP2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
HAMMING -> LIST3
LIST3 -> APP2(s, 0)
LIST1 -> HAMMING
APP2(app2(mult, app2(s, x)), y) -> APP2(app2(plus, y), app2(app2(mult, x), y))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys)))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(eq, x)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))
LIST1 -> APP2(map, app2(mult, app2(s, app2(s, 0))))
APP2(app2(plus, app2(s, x)), y) -> APP2(app2(plus, x), y)
APP2(app2(mult, app2(s, x)), y) -> APP2(plus, y)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(lt, x), y)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, app2(app2(cons, x), xs)), ys)
HAMMING -> APP2(merge, list2)
APP2(app2(mult, app2(s, x)), y) -> APP2(mult, x)
LIST3 -> APP2(s, app2(s, app2(s, app2(s, app2(s, 0)))))
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(cons, app2(f, x))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(merge, xs)
LIST2 -> APP2(s, app2(s, app2(s, 0)))
HAMMING -> APP2(s, 0)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(eq, x), y)
LIST2 -> APP2(s, app2(s, 0))
LIST1 -> APP2(mult, app2(s, app2(s, 0)))
LIST2 -> APP2(mult, app2(s, app2(s, app2(s, 0))))
HAMMING -> APP2(app2(merge, list1), app2(app2(merge, list2), list3))
HAMMING -> LIST2
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys)))
LIST1 -> APP2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, xs), ys)
APP2(app2(lt, app2(s, x)), app2(s, y)) -> APP2(lt, x)
HAMMING -> APP2(cons, app2(s, 0))
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(f, x)
APP2(app2(mult, app2(s, x)), y) -> APP2(app2(mult, x), y)
LIST2 -> HAMMING
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(if, app2(app2(eq, x), y))
APP2(app2(plus, app2(s, x)), y) -> APP2(plus, x)
LIST3 -> APP2(s, app2(s, 0))
APP2(app2(lt, app2(s, x)), app2(s, y)) -> APP2(app2(lt, x), y)
LIST1 -> APP2(s, app2(s, 0))
LIST3 -> APP2(s, app2(s, app2(s, app2(s, 0))))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(if, app2(app2(lt, x), y))
HAMMING -> APP2(app2(merge, list2), list3)
HAMMING -> LIST1
LIST2 -> APP2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
LIST3 -> APP2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0)))))))
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(app2(map, f), xs)
LIST3 -> APP2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))
HAMMING -> APP2(merge, list1)
LIST3 -> APP2(s, app2(s, app2(s, 0)))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
LIST3 -> APP2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
LIST2 -> APP2(map, app2(mult, app2(s, app2(s, app2(s, 0)))))
LIST1 -> APP2(s, 0)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(cons, x), app2(app2(merge, xs), ys))
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ QDP
↳ QDP
↳ QDP
↳ QDP
APP2(app2(plus, app2(s, x)), y) -> APP2(app2(plus, x), y)
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
APP2(app2(plus, app2(s, x)), y) -> APP2(app2(plus, x), y)
POL(APP2(x1, x2)) = x1
POL(app2(x1, x2)) = x1 + x2
POL(plus) = 0
POL(s) = 1
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ PisEmptyProof
↳ QDP
↳ QDP
↳ QDP
↳ QDP
↳ QDP
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ QDP
↳ QDP
↳ QDP
APP2(app2(mult, app2(s, x)), y) -> APP2(app2(mult, x), y)
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
APP2(app2(mult, app2(s, x)), y) -> APP2(app2(mult, x), y)
POL(APP2(x1, x2)) = x1
POL(app2(x1, x2)) = x1 + x2
POL(mult) = 0
POL(s) = 1
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ PisEmptyProof
↳ QDP
↳ QDP
↳ QDP
↳ QDP
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ QDP
↳ QDP
APP2(app2(lt, app2(s, x)), app2(s, y)) -> APP2(app2(lt, x), y)
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
APP2(app2(lt, app2(s, x)), app2(s, y)) -> APP2(app2(lt, x), y)
POL(APP2(x1, x2)) = x2
POL(app2(x1, x2)) = 1 + x1 + x2
POL(lt) = 0
POL(s) = 1
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ PisEmptyProof
↳ QDP
↳ QDP
↳ QDP
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ QDP
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, xs), ys)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, xs), app2(app2(cons, y), ys))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, app2(app2(cons, x), xs)), ys)
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, xs), ys)
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, xs), app2(app2(cons, y), ys))
APP2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> APP2(app2(merge, app2(app2(cons, x), xs)), ys)
POL(APP2(x1, x2)) = x1 + x2
POL(app2(x1, x2)) = 1 + x1 + x2
POL(cons) = 1
POL(merge) = 0
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ PisEmptyProof
↳ QDP
↳ QDP
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ QDP
↳ QDP
↳ QDPOrderProof
↳ QDP
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(f, x)
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(app2(map, f), xs)
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(f, x)
APP2(app2(map, f), app2(app2(cons, x), xs)) -> APP2(app2(map, f), xs)
POL(APP2(x1, x2)) = x2
POL(app2(x1, x2)) = 1 + x1 + x2
POL(cons) = 1
POL(map) = 0
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ QDP
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ PisEmptyProof
↳ QDP
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ QDP
↳ QDP
↳ QDP
HAMMING -> LIST3
LIST2 -> HAMMING
HAMMING -> LIST1
HAMMING -> LIST2
LIST1 -> HAMMING
LIST3 -> HAMMING
app2(app2(app2(if, true), xs), ys) -> xs
app2(app2(app2(if, false), xs), ys) -> ys
app2(app2(lt, app2(s, x)), app2(s, y)) -> app2(app2(lt, x), y)
app2(app2(lt, 0), app2(s, y)) -> true
app2(app2(lt, y), 0) -> false
app2(app2(eq, x), x) -> true
app2(app2(eq, app2(s, x)), 0) -> false
app2(app2(eq, 0), app2(s, x)) -> false
app2(app2(merge, xs), nil) -> xs
app2(app2(merge, nil), ys) -> ys
app2(app2(merge, app2(app2(cons, x), xs)), app2(app2(cons, y), ys)) -> app2(app2(app2(if, app2(app2(lt, x), y)), app2(app2(cons, x), app2(app2(merge, xs), app2(app2(cons, y), ys)))), app2(app2(app2(if, app2(app2(eq, x), y)), app2(app2(cons, x), app2(app2(merge, xs), ys))), app2(app2(cons, y), app2(app2(merge, app2(app2(cons, x), xs)), ys))))
app2(app2(map, f), nil) -> nil
app2(app2(map, f), app2(app2(cons, x), xs)) -> app2(app2(cons, app2(f, x)), app2(app2(map, f), xs))
app2(app2(mult, 0), x) -> 0
app2(app2(mult, app2(s, x)), y) -> app2(app2(plus, y), app2(app2(mult, x), y))
app2(app2(plus, 0), x) -> 0
app2(app2(plus, app2(s, x)), y) -> app2(s, app2(app2(plus, x), y))
list1 -> app2(app2(map, app2(mult, app2(s, app2(s, 0)))), hamming)
list2 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, 0))))), hamming)
list3 -> app2(app2(map, app2(mult, app2(s, app2(s, app2(s, app2(s, app2(s, 0))))))), hamming)
hamming -> app2(app2(cons, app2(s, 0)), app2(app2(merge, list1), app2(app2(merge, list2), list3)))